/*
 * @Author: your name
 * @Date: 2020-10-31 01:07:04
 * @LastEditTime: 2020-11-30 16:18:46
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \profess-baidu-2\packageB\pages\want1\want1.js
 */
const app = getApp();

Page({
    data: {
        professRecordEntity:{},
    },

    toNext(e) {
        swan.navigateTo({
            url: `../want2/want2?professRecordId`
        });
    },
    onLoad: function () {


        // if(options.professRecordId == undefined || options.professRecordId == ''){
        //     app.showToastFail('参数不合法！')
        //     return
        // }
        let professRecordId = app.cache.get('professRecordId')
        // return ;
        swan.request({

            url:app.globalData.URL + `/8100/profess-record/findEntityById/${professRecordId}`,
            method: 'get',
            success:res=>{

                if(res.data.code != 200){
                    app.showToastFail(res.data.msg)
                    return;
                }
                console.log(res);

                // console.log(res.data.data)

                this.setData({
                    professRecordEntity: res.data.data
                })

                this.setData({
                    'professRecordEntity.from.aprisKeyWords': JSON.parse(this.data.professRecordEntity.from.aprisKeyWords)
                })

            }
        })

        // 监听页面加载的生命周期函数
    },
    onReady: function() {
        // 监听页面初次渲染完成的生命周期函数
    },
    onShow: function() {
        // 监听页面显示的生命周期函数
    },
    onHide: function() {
        // 监听页面隐藏的生命周期函数
    },
    onUnload: function() {
        // 监听页面卸载的生命周期函数
    },
    onPullDownRefresh: function() {
        // 监听用户下拉动作
    },
    onReachBottom: function() {
        // 页面上拉触底事件的处理函数
    },
    onShareAppMessage: function () {
        // 用户点击右上角转发
    }
});